&ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI adm2
&ANALYZE-RESUME
&Scoped-define WINDOW-NAME CURRENT-WINDOW


/* Temp-Table and Buffer definitions                                    */
DEFINE TEMP-TABLE ab_unmap
       FIELD abonews AS LOGICAL  INITIAL no
       FIELD adr1f AS CHARACTER FORMAT "X(256)":U 
       FIELD adr1l AS CHARACTER FORMAT "X(256)":U 
       FIELD adr2f AS CHARACTER FORMAT "X(256)":U 
       FIELD adr2l AS CHARACTER FORMAT "X(256)":U 
       FIELD adr3f AS CHARACTER FORMAT "X(256)":U 
       FIELD adr3l AS CHARACTER FORMAT "X(256)":U 
       FIELD alang AS CHARACTER FORMAT "X(256)":U 
       FIELD article_bas AS CHARACTER FORMAT "X(256)":U 
       FIELD article_ent AS CHARACTER FORMAT "X(256)":U 
       FIELD article_sais AS CHARACTER FORMAT "X(256)":U 
       FIELD cgv AS LOGICAL  INITIAL no
       FIELD civilf AS CHARACTER FORMAT "X(256)":U 
       FIELD civill AS CHARACTER FORMAT "X(256)":U 
       FIELD emailx AS CHARACTER FORMAT "X(256)":U 
       FIELD err_adr AS CHARACTER FORMAT "X(256)":U 
       FIELD err_cgv AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_adr AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_adresse AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_cgv AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_civil AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_livr AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_local AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_mail AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_mess AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_mobli AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_news AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_nom AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_pays AS CHARACTER FORMAT "X(256)":U 
       FIELD lab_ref AS CHARACTER FORMAT "X(256)":U 
       FIELD localf AS CHARACTER FORMAT "X(256)":U 
       FIELD locall AS CHARACTER FORMAT "X(256)":U 
       FIELD message2 AS CHARACTER 
       FIELD monnaie_doc AS CHARACTER FORMAT "X(256)":U 
       FIELD navigue AS CHARACTER FORMAT "X(256)":U 
       FIELD nomfx AS CHARACTER FORMAT "X(256)":U 
       FIELD nomlx AS CHARACTER FORMAT "X(256)":U 
       FIELD par-id AS CHARACTER FORMAT "X(256)":U 
       FIELD par-noseq AS CHARACTER FORMAT "X(256)":U 
       FIELD par-nosui AS CHARACTER FORMAT "X(256)":U 
       FIELD par-retour AS CHARACTER FORMAT "X(256)":U 
       FIELD paysf AS CHARACTER FORMAT "X(256)":U 
       FIELD paysl AS CHARACTER FORMAT "X(256)":U 
       FIELD refcom AS CHARACTER FORMAT "X(256)":U 
       FIELD refs AS CHARACTER FORMAT "X(256)":U 
       FIELD texte01 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte02 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte03 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte04 AS CHARACTER FORMAT "X(256)":U 
       FIELD texte05 AS CHARACTER FORMAT "X(256)":U 
       FIELD validation AS CHARACTER FORMAT "X(256)":U .



&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS w-html 
/*------------------------------------------------------------------------

  File: 

  Description: 

  Input Parameters:
      <none>

  Output Parameters:
      <none>

  Author: 

  Created: 

------------------------------------------------------------------------*/
/*           This .W file was created with AppBuilder.                  */
/*----------------------------------------------------------------------*/

/* Create an unnamed pool to store all the widgets created 
     by this procedure. This is a good default which assures
     that this procedure's triggers and internal procedures 
     will execute in this procedure's storage, and that proper
     cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.

/* ***************************  Definitions  ************************** */

/* Preprocessor Definitions ---                                         */

/* Parameters Definitions ---                                           */

/* Local Variable Definitions ---                                       */

DEF NEW SHARED BUFFER doce     FOR doce.
DEF NEW SHARED BUFFER docld    FOR docld.
DEF            BUFFER wk-doce  FOR doce.

DEF NEW SHARED VAR a-lang          AS    INTEGER                   NO-UNDO.
DEF            VAR nb-ligne        AS    INTEGER                   NO-UNDO.
DEF            VAR i               AS    INTEGER                   NO-UNDO.
DEF            VAR j               AS    INTEGER                   NO-UNDO.
DEF            VAR nomprg          AS    CHARACTER                 NO-UNDO.
DEF            VAR lab-bouton      AS    CHARACTER EXTENT 5        NO-UNDO.
DEF            VAR action          AS    CHARACTER                 NO-UNDO.

DEF            VAR buf-nocli       LIKE doce.noadrf                NO-UNDO.
DEF            VAR buf-csmt        LIKE doce.csmtf                 NO-UNDO.
DEF            VAR buf-prefix      LIKE doce.prefix                NO-UNDO.
DEF            VAR buf-nodoc       LIKE doce.nodoc                 NO-UNDO.
DEF            VAR buf-rabais      LIKE docld.rabais               NO-UNDO.


DEF            VAR buf-pumb         LIKE docld.punite NO-UNDO.
DEF            VAR buf-punite       LIKE docld.punite NO-UNDO.
DEF            VAR buf-unitp        LIKE docld.unitp  NO-UNDO.
DEF            VAR buf-nocpt        LIKE docld.nocpt  NO-UNDO.
DEF            VAR buf-taxi         LIKE docld.taxi   NO-UNDO.

DEF            VAR flag-art        AS   LOGICAL                    NO-UNDO.
DEF            VAR flag-rem        AS   LOGICAL                    NO-UNDO.
DEF            VAR flag-lgdoc      AS   LOGICAL                    NO-UNDO.

DEF            VAR buf-qte         AS   INTEGER             NO-UNDO.
DEF            VAR buf-ref         AS   CHARACTER           NO-UNDO.

DEF NEW SHARED VAR nomchamp        AS CHARACTER EXTENT 2 
                   INIT ["ref","qte"] NO-UNDO.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK 

/* ********************  Preprocessor Definitions  ******************** */

&Scoped-define PROCEDURE-TYPE Web-Object
&Scoped-define DB-AWARE no

&Scoped-define WEB-FILE commande_envoi.htm

/* Name of designated FRAME-NAME and/or first browse and/or first query */
&Scoped-define FRAME-NAME Web-Frame

/* Standard List Definitions                                            */
&Scoped-Define ENABLED-OBJECTS ab_unmap.err_cgv ab_unmap.cgv ~
ab_unmap.lab_cgv ab_unmap.lab_mobli ab_unmap.lab_adresse ab_unmap.lab_civil ~
ab_unmap.lab_local ab_unmap.lab_nom ab_unmap.lab_pays ab_unmap.civilf ~
ab_unmap.civill ab_unmap.adr1f ab_unmap.adr1l ab_unmap.adr2f ab_unmap.adr2l ~
ab_unmap.adr3f ab_unmap.adr3l ab_unmap.localf ab_unmap.locall ~
ab_unmap.nomfx ab_unmap.nomlx ab_unmap.paysf ab_unmap.paysl ~
ab_unmap.err_adr ab_unmap.alang ab_unmap.abonews ab_unmap.lab_news ~
ab_unmap.texte01 ab_unmap.texte02 ab_unmap.texte03 ab_unmap.texte04 ~
ab_unmap.texte05 ab_unmap.lab_adr ab_unmap.lab_livr ab_unmap.lab_mail ~
ab_unmap.lab_mess ab_unmap.lab_ref ab_unmap.validation ab_unmap.navigue ~
ab_unmap.emailx ab_unmap.message2 ab_unmap.refcom ab_unmap.monnaie_doc ~
ab_unmap.article_bas ab_unmap.article_ent ab_unmap.par-retour ab_unmap.refs ~
ab_unmap.article_sais ab_unmap.par-id ab_unmap.par-noseq ab_unmap.par-nosui 
&Scoped-Define DISPLAYED-OBJECTS ab_unmap.err_cgv ab_unmap.cgv ~
ab_unmap.lab_cgv ab_unmap.lab_mobli ab_unmap.lab_adresse ab_unmap.lab_civil ~
ab_unmap.lab_local ab_unmap.lab_nom ab_unmap.lab_pays ab_unmap.civilf ~
ab_unmap.civill ab_unmap.adr1f ab_unmap.adr1l ab_unmap.adr2f ab_unmap.adr2l ~
ab_unmap.adr3f ab_unmap.adr3l ab_unmap.localf ab_unmap.locall ~
ab_unmap.nomfx ab_unmap.nomlx ab_unmap.paysf ab_unmap.paysl ~
ab_unmap.err_adr ab_unmap.alang ab_unmap.abonews ab_unmap.lab_news ~
ab_unmap.texte01 ab_unmap.texte02 ab_unmap.texte03 ab_unmap.texte04 ~
ab_unmap.texte05 ab_unmap.lab_adr ab_unmap.lab_livr ab_unmap.lab_mail ~
ab_unmap.lab_mess ab_unmap.lab_ref ab_unmap.validation ab_unmap.navigue ~
ab_unmap.emailx ab_unmap.message2 ab_unmap.refcom ab_unmap.monnaie_doc ~
ab_unmap.article_bas ab_unmap.article_ent ab_unmap.par-retour ab_unmap.refs ~
ab_unmap.article_sais ab_unmap.par-id ab_unmap.par-noseq ab_unmap.par-nosui 

/* Custom List Definitions                                              */
/* List-1,List-2,List-3,List-4,List-5,List-6                            */

/* _UIB-PREPROCESSOR-BLOCK-END */
&ANALYZE-RESUME



/* ***********************  Control Definitions  ********************** */


/* Definitions of the field level widgets                               */

/* ************************  Frame Definitions  *********************** */

DEFINE FRAME Web-Frame
     ab_unmap.err_cgv AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.cgv AT ROW 1 COL 1 HELP
          ""
          LABEL "cgv"
          VIEW-AS TOGGLE-BOX
          SIZE 20 BY 1
     ab_unmap.lab_cgv AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_mobli AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_adresse AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_civil AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_local AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_nom AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_pays AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.civilf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.civill AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr1f AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr1l AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr2f AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr2l AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr3f AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.adr3l AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.localf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.locall AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.nomfx AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.nomlx AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.paysf AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.paysl AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.err_adr AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.alang AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 57.63 BY 14.13.

/* DEFINE FRAME statement is approaching 4K Bytes.  Breaking it up   */
DEFINE FRAME Web-Frame
     ab_unmap.abonews AT ROW 1 COL 1 HELP
          ""
          LABEL "abonews"
          VIEW-AS TOGGLE-BOX
          SIZE 20 BY 1
     ab_unmap.lab_news AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte01 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte02 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte03 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte04 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.texte05 AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_adr AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_livr AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_mail AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_mess AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.lab_ref AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.validation AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.navigue AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.emailx AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.message2 AT ROW 1 COL 1 HELP
          "" NO-LABEL
          VIEW-AS EDITOR NO-WORD-WRAP
          SIZE 20 BY 4
     ab_unmap.refcom AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.monnaie_doc AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.article_bas AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.article_ent AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.par-retour AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.refs AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.article_sais AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 57.63 BY 14.13.

/* DEFINE FRAME statement is approaching 4K Bytes.  Breaking it up   */
DEFINE FRAME Web-Frame
     ab_unmap.par-id AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.par-noseq AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
     ab_unmap.par-nosui AT ROW 1 COL 1 HELP
          "" NO-LABEL FORMAT "X(256)":U
          VIEW-AS FILL-IN 
          SIZE 20 BY 1
    WITH 1 DOWN KEEP-TAB-ORDER OVERLAY 
         SIDE-LABELS 
         AT COL 1 ROW 1
         SIZE 57.63 BY 14.13.


/* *********************** Procedure Settings ************************ */

&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
   Type: Web-Object
   Allow: Query
   Frames: 1
   Add Fields to: Neither
   Editing: Special-Events-Only
   Events: web.output,web.input
   Other Settings: COMPILE
   Temp-Tables and Buffers:
      TABLE: ab_unmap W "?" ?  
      ADDITIONAL-FIELDS:
          FIELD abonews AS LOGICAL  INITIAL no
          FIELD adr1f AS CHARACTER FORMAT "X(256)":U 
          FIELD adr1l AS CHARACTER FORMAT "X(256)":U 
          FIELD adr2f AS CHARACTER FORMAT "X(256)":U 
          FIELD adr2l AS CHARACTER FORMAT "X(256)":U 
          FIELD adr3f AS CHARACTER FORMAT "X(256)":U 
          FIELD adr3l AS CHARACTER FORMAT "X(256)":U 
          FIELD alang AS CHARACTER FORMAT "X(256)":U 
          FIELD article_bas AS CHARACTER FORMAT "X(256)":U 
          FIELD article_ent AS CHARACTER FORMAT "X(256)":U 
          FIELD article_sais AS CHARACTER FORMAT "X(256)":U 
          FIELD cgv AS LOGICAL  INITIAL no
          FIELD civilf AS CHARACTER FORMAT "X(256)":U 
          FIELD civill AS CHARACTER FORMAT "X(256)":U 
          FIELD emailx AS CHARACTER FORMAT "X(256)":U 
          FIELD err_adr AS CHARACTER FORMAT "X(256)":U 
          FIELD err_cgv AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_adr AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_adresse AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_cgv AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_civil AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_livr AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_local AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_mail AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_mess AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_mobli AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_news AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_nom AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_pays AS CHARACTER FORMAT "X(256)":U 
          FIELD lab_ref AS CHARACTER FORMAT "X(256)":U 
          FIELD localf AS CHARACTER FORMAT "X(256)":U 
          FIELD locall AS CHARACTER FORMAT "X(256)":U 
          FIELD message2 AS CHARACTER 
          FIELD monnaie_doc AS CHARACTER FORMAT "X(256)":U 
          FIELD navigue AS CHARACTER FORMAT "X(256)":U 
          FIELD nomfx AS CHARACTER FORMAT "X(256)":U 
          FIELD nomlx AS CHARACTER FORMAT "X(256)":U 
          FIELD par-id AS CHARACTER FORMAT "X(256)":U 
          FIELD par-noseq AS CHARACTER FORMAT "X(256)":U 
          FIELD par-nosui AS CHARACTER FORMAT "X(256)":U 
          FIELD par-retour AS CHARACTER FORMAT "X(256)":U 
          FIELD paysf AS CHARACTER FORMAT "X(256)":U 
          FIELD paysl AS CHARACTER FORMAT "X(256)":U 
          FIELD refcom AS CHARACTER FORMAT "X(256)":U 
          FIELD refs AS CHARACTER FORMAT "X(256)":U 
          FIELD texte01 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte02 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte03 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte04 AS CHARACTER FORMAT "X(256)":U 
          FIELD texte05 AS CHARACTER FORMAT "X(256)":U 
          FIELD validation AS CHARACTER FORMAT "X(256)":U 
      END-FIELDS.
   END-TABLES.
 */
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS

/* *************************  Create Window  ************************** */

&ANALYZE-SUSPEND _CREATE-WINDOW
/* DESIGN Window definition (used by the UIB) 
  CREATE WINDOW w-html ASSIGN
         HEIGHT             = 14.13
         WIDTH              = 57.63.
/* END WINDOW DEFINITION */
                                                                        */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB w-html 
/* *********************** Included-Libraries ************************* */

{src/web2/html-map.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME




/* ***********  Runtime Attributes and AppBuilder Settings  *********** */

&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
/* SETTINGS FOR WINDOW w-html
  VISIBLE,,RUN-PERSISTENT                                               */
/* SETTINGS FOR FRAME Web-Frame
   FRAME-NAME UNDERLINE                                                 */
/* SETTINGS FOR TOGGLE-BOX ab_unmap.abonews IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.adr1f IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.adr1l IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.adr2f IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.adr2l IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.adr3f IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.adr3l IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.alang IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.article_bas IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.article_ent IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.article_sais IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR TOGGLE-BOX ab_unmap.cgv IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.civilf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.civill IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.emailx IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.err_adr IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.err_cgv IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_adr IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_adresse IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_cgv IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_civil IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_livr IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_local IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_mail IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_mess IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_mobli IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_news IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_nom IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_pays IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.lab_ref IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.localf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.locall IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR EDITOR ab_unmap.message2 IN FRAME Web-Frame
   EXP-LABEL EXP-FORMAT EXP-HELP                                        */
/* SETTINGS FOR FILL-IN ab_unmap.monnaie_doc IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.navigue IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.nomfx IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.nomlx IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.par-id IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.par-noseq IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.par-nosui IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.par-retour IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.paysf IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.paysl IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.refcom IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.refs IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte01 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte02 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte03 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte04 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.texte05 IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* SETTINGS FOR FILL-IN ab_unmap.validation IN FRAME Web-Frame
   ALIGN-L EXP-LABEL EXP-FORMAT EXP-HELP                                */
/* _RUN-TIME-ATTRIBUTES-END */
&ANALYZE-RESUME

 



/* ************************  Control Triggers  ************************ */

&Scoped-define SELF-NAME ab_unmap.article_bas
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.article_bas w-html WEB.output
PROCEDURE ab_unmap.article_bas.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR nom_page        AS    CHARACTER         NO-UNDO.
  DEF VAR ligne           AS    CHARACTER         NO-UNDO.
  DEF VAR lst-tag         AS    CHARACTER         NO-UNDO.
  DEF VAR pos             AS    INTEGER           NO-UNDO.
  DEF VAR txt_aff         AS    CHARACTER         NO-UNDO.

  DO WITH FRAME {&FRAME-NAME}:
  
      IF NOT flag-lgdoc THEN RETURN.

      txt_aff = "". 

      FIND erreur WHERE erreur.noerr = 101057
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      txt_aff = txt_aff + IF NOT AVAILABLE erreur THEN "&nbsp;" 
                          ELSE erreur.libel.

      FIND erreur WHERE erreur.noerr = 101012
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      txt_aff = txt_aff + "#" + erreur.libel
              + "#" + STRING(doce.totme - doce.totqte - doce.totmtn + doce.totme,"->>>,>>9.99").
      
      FIND erreur WHERE erreur.noerr = 101058
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      txt_aff = txt_aff + "#" + IF NOT AVAILABLE erreur THEN "&nbsp;" 
                          ELSE erreur.libel.     
      
      FIND erreur WHERE erreur.noerr = 101014
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      txt_aff = txt_aff + "#" + erreur.libel
              + "#" + STRING(doce.totqte + doce.totmtn - doce.totme,"->>>,>>9.99").
      
      FIND erreur WHERE erreur.noerr = 101059
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      txt_aff = txt_aff + "#" + IF NOT AVAILABLE erreur THEN "&nbsp;" 
                          ELSE erreur.libel.

      FIND erreur WHERE erreur.noerr = 101013
                    AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
      txt_aff = txt_aff + "#" + erreur.libel
              + "#" + STRING(doce.totme,"->>>,>>9.99").

      txt_aff = txt_aff + "#" + doce.codmon.

      nom_page = SEARCH("commande_bas.htm").
      IF nom_page = ? THEN RETURN.
      INPUT FROM VALUE(nom_page).
      REPEAT:
         IMPORT UNFORMATTED ligne.
         pos = INDEX(ligne,"<!--WSTAG").
         IF TRIM(ligne) BEGINS "<!--" AND pos = 0 THEN NEXT.
         IF pos = 0 THEN {&out} ligne SKIP.
         ELSE DO:
            RUN decode_tag(ligne,"champ",OUTPUT lst-tag).
            DO i = 1 TO NUM-ENTRIES(lst-tag).
               RUN remplace_tag ("champ",10,ENTRY(i,lst-tag),txt_aff,INPUT-OUTPUT ligne).
            END.
            {&out} ligne SKIP.
         END.
      END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.article_ent
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.article_ent w-html WEB.output
PROCEDURE ab_unmap.article_ent.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DEF VAR nom_page        AS CHARACTER      NO-UNDO.
  DEF VAR ligne           AS CHARACTER      NO-UNDO.
  DEF VAR lst-tag         AS CHARACTER      NO-UNDO.
  DEF VAR pos             AS INTEGER        NO-UNDO.
  DEF VAR nb              AS INTEGER        NO-UNDO.
  DEF VAR buf-mess        AS CHARACTER      NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
  
      buf-mess = "".

      IF NOT flag-lgdoc THEN DO:
         FIND erreur WHERE erreur.noerr = 101054
                       AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
         IF AVAILABLE erreur THEN buf-mess = buf-mess + erreur.libel.
         nom_page = SEARCH("commande_vide.htm").
      END.
      ELSE DO:
         FIND erreur WHERE erreur.noerr = 101009
                        AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
         IF AVAILABLE erreur THEN buf-mess = buf-mess + erreur.libel. 
         nom_page = SEARCH("commande_entete.htm").


         IF flag-lgdoc AND (doce.noadrf = 1000 OR doce.noadrf = 1001) THEN DO:
            FIND erreur WHERE erreur.noerr = 101055
                           AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
            buf-mess = buf-mess + "#" + ENTRY(1,erreur.libel,"#").

            buf-mess = buf-mess + "#" + "<input name=~"monnaie~" type=~"radio~" value=~"CHF~" onClick=~"document.commande.submit();~"".
            IF doce.codmon = "CHF" THEN  buf-mess = buf-mess + " checked".

            buf-mess = buf-mess + ">".
            buf-mess = buf-mess + "#" + ENTRY(2,erreur.libel,"#").

            buf-mess = buf-mess + "#" + "<input name=~"monnaie~" type=~"radio~" value=~"EUR~" onClick=~"document.commande.submit();~"".
            IF doce.codmon = "EUR" THEN  buf-mess = buf-mess + " checked".
            buf-mess = buf-mess + ">".
         END.

      END.

      nb = NUM-ENTRIES(buf-mess,"#").

      IF nom_page = ? THEN RETURN.
      INPUT FROM VALUE(nom_page).
      REPEAT:
         IMPORT UNFORMATTED ligne.
         pos = INDEX(ligne,"<!--WSTAG").
         IF TRIM(ligne) BEGINS "<!--" AND pos = 0 THEN NEXT.
         IF pos = 0 THEN {&out} ligne SKIP.
         ELSE DO:
            RUN decode_tag(ligne,"label",OUTPUT lst-tag).
            DO i = 1 TO NUM-ENTRIES(lst-tag).
               RUN remplace_tag ("label",nb,ENTRY(i,lst-tag),buf-mess,INPUT-OUTPUT ligne).
            END.
            {&out} ligne SKIP.
         END.
      END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.article_sais
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.article_sais w-html WEB.output
PROCEDURE ab_unmap.article_sais.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.

  DEF VAR flag-trouve     AS    LOGICAL           NO-UNDO.
  DEF VAR txt_aff         AS    CHARACTER         NO-UNDO.
  DEF VAR nom_page        AS    CHARACTER         NO-UNDO.
  DEF VAR ligne           AS    CHARACTER         NO-UNDO.
  DEF VAR lst-tag         AS    CHARACTER         NO-UNDO.
  DEF VAR pos             AS    INTEGER           NO-UNDO.
  DEF VAR i               AS    INTEGER           NO-UNDO.
  DEF VAR num             AS    INTEGER           NO-UNDO.
  
  FOR EACH docld WHERE docld.nosoc  = doce.nosoc
                   AND docld.typdoc = doce.typdoc
                   AND docld.prefix = doce.prefix
                   AND docld.nodoc  = doce.nodoc NO-LOCK:
      IF docld.ref = "" THEN NEXT.

      FIND arti WHERE arti.nosoc = docld.nosoc
                  AND arti.ref   = docld.ref NO-LOCK NO-ERROR.

      IF NOT AVAILABLE arti THEN NEXT.
            flag-art = TRUE.

      txt_aff = "<a href=~"commande_delart.w?RowId=" + STRING(ROWID(docld))
              + "~"><img border=~"0~" src=~"/images/annuler.gif~"></a>".
      txt_aff = txt_aff + "#" + "<input type=~"text~" name=~"qtes" + STRING(docld.noseq)
              + "~" value=~"" + STRING(docld.qtec) + "~" size=~"6~" onchange=~"return ctrlZone(this,3,'4');~""
              + " style=~"text-align: right~">".

      txt_aff = txt_aff + "#" + arti.titre + "#" + arti.auteur + "#" + ENTRY(1,arti.DESCRIPTION,CHR(10)).
      txt_aff = txt_aff + "#" + STRING(docld.punite,"zz,zz9.99").
      txt_aff = txt_aff + "#" + STRING(docld.rabais,"zz9.99 %").
      txt_aff = txt_aff + "#" + STRING(docld.montne,"zzz,zz9.99").
      txt_aff = txt_aff + "#" + doce.codmon + "#" + docld.ref.

      nom_page = SEARCH("commande_ligne.htm").
      IF nom_page = ? THEN RETURN.
      INPUT FROM VALUE(nom_page).
      REPEAT:
         IMPORT UNFORMATTED ligne.
         pos = INDEX(ligne,"<!--WSTAG").
         IF TRIM(ligne) BEGINS "<!--" AND pos = 0 THEN NEXT.
         IF pos = 0 THEN {&out} ligne SKIP.
         ELSE DO:
            RUN decode_tag(ligne,"champ",OUTPUT lst-tag).
            DO i = 1 TO NUM-ENTRIES(lst-tag).
               RUN remplace_tag ("champ",10,ENTRY(i,lst-tag),txt_aff,INPUT-OUTPUT ligne).
            END.
            {&out} ligne SKIP.
         END.
      END.
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.err_adr
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.err_adr w-html WEB.output
PROCEDURE ab_unmap.err_adr.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN aff_label(101044).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.err_cgv
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.err_cgv w-html WEB.output
PROCEDURE ab_unmap.err_cgv.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101131).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_adr
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_adr w-html WEB.output
PROCEDURE ab_unmap.lab_adr.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101071).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_adresse
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_adresse w-html WEB.output
PROCEDURE ab_unmap.lab_adresse.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101117).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_cgv
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_cgv w-html WEB.output
PROCEDURE ab_unmap.lab_cgv.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN aff_label(101130).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_civil
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_civil w-html WEB.output
PROCEDURE ab_unmap.lab_civil.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101115).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_livr
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_livr w-html WEB.output
PROCEDURE ab_unmap.lab_livr.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101072).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_local
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_local w-html WEB.output
PROCEDURE ab_unmap.lab_local.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101118).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_mail
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_mail w-html WEB.output
PROCEDURE ab_unmap.lab_mail.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101073).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_mess
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_mess w-html WEB.output
PROCEDURE ab_unmap.lab_mess.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN aff_label(101011).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_mobli
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_mobli w-html WEB.output
PROCEDURE ab_unmap.lab_mobli.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101120).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_news
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_news w-html WEB.output
PROCEDURE ab_unmap.lab_news.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      RUN aff_label(101089).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_nom
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_nom w-html WEB.output
PROCEDURE ab_unmap.lab_nom.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101116).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_pays
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_pays w-html WEB.output
PROCEDURE ab_unmap.lab_pays.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101119).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.lab_ref
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.lab_ref w-html WEB.output
PROCEDURE ab_unmap.lab_ref.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101046).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.navigue
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.navigue w-html WEB.output
PROCEDURE ab_unmap.navigue.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      IF flag-art THEN RUN bouton.r (101000,a-lang).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte01
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte01 w-html WEB.output
PROCEDURE ab_unmap.texte01.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101074).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte02
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte02 w-html WEB.output
PROCEDURE ab_unmap.texte02.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101075).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte03
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte03 w-html WEB.output
PROCEDURE ab_unmap.texte03.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101076).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte04
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte04 w-html WEB.output
PROCEDURE ab_unmap.texte04.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101077).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.texte05
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.texte05 w-html WEB.output
PROCEDURE ab_unmap.texte05.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
     RUN aff_label(101078).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&Scoped-define SELF-NAME ab_unmap.validation
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ab_unmap.validation w-html WEB.output
PROCEDURE ab_unmap.validation.output .
/*------------------------------------------------------------------------------
  Purpose:     Output the value of the field to the WEB stream
               in place of the HTML field definition.
  Parameters:  p-field-defn
  Notes:       
------------------------------------------------------------------------------*/
  DEFINE INPUT PARAMETER p-field-defn AS CHARACTER NO-UNDO.
  
  DO WITH FRAME {&FRAME-NAME}:
      IF flag-art THEN RUN bouton.r (101002,a-lang).
  END.
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


&UNDEFINE SELF-NAME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK w-html 


/* ************************  Main Code Block  ************************* */

/* Standard Main Block that runs adm-create-objects, initializeObject 
 * and process-web-request.
 * The bulk of the web processing is in the Procedure process-web-request
 * elsewhere in this Web object.
 */
{src/web2/template/hmapmain.i}

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME


/* **********************  Internal Procedures  *********************** */

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects w-html  _ADM-CREATE-OBJECTS
PROCEDURE adm-create-objects :
/*------------------------------------------------------------------------------
  Purpose:     Create handles for all SmartObjects used in this procedure.
               After SmartObjects are initialized, then SmartLinks are added.
  Parameters:  <none>
------------------------------------------------------------------------------*/

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE aff_label w-html 
PROCEDURE aff_label :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

  DEF INPUT PARAMETER num  AS INTEGER NO-UNDO.
  FIND erreur WHERE erreur.noerr = num
                AND erreur.lang  = a-lang NO-LOCK NO-ERROR.

  IF AVAILABLE erreur AND erreur.libel <> "" THEN {&out} TRIM(erreur.libel).
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE calcul_mtligne w-html 
PROCEDURE calcul_mtligne :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

{calcul_ligne.i}

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE creation_ligne w-html 
PROCEDURE creation_ligne :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

{creation_ligne.i}

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE decode_tag w-html 
PROCEDURE decode_tag :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

DEF INPUT  PARAMETER ligne    AS CHARACTER           NO-UNDO.
DEF INPUT  PARAMETER ancre    AS CHARACTER           NO-UNDO.
DEF OUTPUT PARAMETER lst-tag  AS CHARACTER           NO-UNDO.

DEF VAR i              AS INTEGER           NO-UNDO.
DEF VAR j              AS INTEGER           NO-UNDO.
DEF VAR pos            AS INTEGER           NO-UNDO.
DEF VAR tag            AS CHARACTER         NO-UNDO.

REPEAT:
   i = INDEX(ligne,"<!--").
   j = IF INDEX(ligne,"-->") <> 0 THEN INDEX(ligne,"-->") + 2 ELSE LENGTH(ligne).
   IF i = 0 THEN LEAVE.
   tag = SUBSTRING(ligne,i,j - i + 1).
   pos = INDEX(tag,"<!--WSTAG").
   IF pos <> 0 THEN DO:
      pos = INDEX(tag,ancre).
      IF pos <> 0 AND LOOKUP(tag,lst-tag) = 0 THEN lst-tag = lst-tag + "," + tag.
   END.
   ligne = SUBSTRING(ligne,j + 1).
END.
lst-tag = SUBSTRING(lst-tag,2).

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE htmOffsets w-html  _WEB-HTM-OFFSETS
PROCEDURE htmOffsets :
/*------------------------------------------------------------------------------
  Purpose:     Runs procedure to associate each HTML field with its
               corresponding widget name and handle.
  Parameters:  
  Notes:       
------------------------------------------------------------------------------*/
  RUN readOffsets ("{&WEB-FILE}":U).
  RUN htmAssociate
    ("adr1f":U,"ab_unmap.adr1f":U,ab_unmap.adr1f:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("adr1l":U,"ab_unmap.adr1l":U,ab_unmap.adr1l:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("adr2f":U,"ab_unmap.adr2f":U,ab_unmap.adr2f:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("adr2l":U,"ab_unmap.adr2l":U,ab_unmap.adr2l:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("adr3f":U,"ab_unmap.adr3f":U,ab_unmap.adr3f:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("adr3l":U,"ab_unmap.adr3l":U,ab_unmap.adr3l:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("article_bas":U,"ab_unmap.article_bas":U,ab_unmap.article_bas:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("article_ent":U,"ab_unmap.article_ent":U,ab_unmap.article_ent:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("article_sais":U,"ab_unmap.article_sais":U,ab_unmap.article_sais:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("cgv":U,"ab_unmap.cgv":U,ab_unmap.cgv:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("civilf":U,"ab_unmap.civilf":U,ab_unmap.civilf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("civill":U,"ab_unmap.civill":U,ab_unmap.civill:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("emailx":U,"ab_unmap.emailx":U,ab_unmap.emailx:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("err_adr":U,"ab_unmap.err_adr":U,ab_unmap.err_adr:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("err_cgv":U,"ab_unmap.err_cgv":U,ab_unmap.err_cgv:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_adr":U,"ab_unmap.lab_adr":U,ab_unmap.lab_adr:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_adresse":U,"ab_unmap.lab_adresse":U,ab_unmap.lab_adresse:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_cgv":U,"ab_unmap.lab_cgv":U,ab_unmap.lab_cgv:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_civil":U,"ab_unmap.lab_civil":U,ab_unmap.lab_civil:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_livr":U,"ab_unmap.lab_livr":U,ab_unmap.lab_livr:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_local":U,"ab_unmap.lab_local":U,ab_unmap.lab_local:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_mail":U,"ab_unmap.lab_mail":U,ab_unmap.lab_mail:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_mess":U,"ab_unmap.lab_mess":U,ab_unmap.lab_mess:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_mobli":U,"ab_unmap.lab_mobli":U,ab_unmap.lab_mobli:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_news":U,"ab_unmap.lab_news":U,ab_unmap.lab_news:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_nom":U,"ab_unmap.lab_nom":U,ab_unmap.lab_nom:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_pays":U,"ab_unmap.lab_pays":U,ab_unmap.lab_pays:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lab_ref":U,"ab_unmap.lab_ref":U,ab_unmap.lab_ref:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("lang":U,"ab_unmap.alang":U,ab_unmap.alang:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("localf":U,"ab_unmap.localf":U,ab_unmap.localf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("locall":U,"ab_unmap.locall":U,ab_unmap.locall:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("message":U,"ab_unmap.message2":U,ab_unmap.message2:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("monnaie_doc":U,"ab_unmap.monnaie_doc":U,ab_unmap.monnaie_doc:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("navigue":U,"ab_unmap.navigue":U,ab_unmap.navigue:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("news":U,"ab_unmap.abonews":U,ab_unmap.abonews:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("nomfx":U,"ab_unmap.nomfx":U,ab_unmap.nomfx:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("nomlx":U,"ab_unmap.nomlx":U,ab_unmap.nomlx:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("par-id":U,"ab_unmap.par-id":U,ab_unmap.par-id:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("par-noseq":U,"ab_unmap.par-noseq":U,ab_unmap.par-noseq:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("par-nosui":U,"ab_unmap.par-nosui":U,ab_unmap.par-nosui:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("par-retour":U,"ab_unmap.par-retour":U,ab_unmap.par-retour:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("paysf":U,"ab_unmap.paysf":U,ab_unmap.paysf:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("paysl":U,"ab_unmap.paysl":U,ab_unmap.paysl:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("ref":U,"ab_unmap.refcom":U,ab_unmap.refcom:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("refs":U,"ab_unmap.refs":U,ab_unmap.refs:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte01":U,"ab_unmap.texte01":U,ab_unmap.texte01:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte02":U,"ab_unmap.texte02":U,ab_unmap.texte02:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte03":U,"ab_unmap.texte03":U,ab_unmap.texte03:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte04":U,"ab_unmap.texte04":U,ab_unmap.texte04:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("texte05":U,"ab_unmap.texte05":U,ab_unmap.texte05:HANDLE IN FRAME {&FRAME-NAME}).
  RUN htmAssociate
    ("validation":U,"ab_unmap.validation":U,ab_unmap.validation:HANDLE IN FRAME {&FRAME-NAME}).
END PROCEDURE.


/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE modification_document w-html 
PROCEDURE modification_document :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/
DEF            VAR i             AS   INTEGER             NO-UNDO.
DEF            VAR j             AS   INTEGER             NO-UNDO.
DEF            VAR buf-qte       AS   INTEGER             NO-UNDO.
DEF            VAR buf-ref       AS   CHARACTER           NO-UNDO.
DEF            VAR buf-art       AS   CHARACTER           NO-UNDO.
DEF            VAR flag-monnaie  AS LOGICAL               NO-UNDO.

DO WITH FRAME {&FRAME-NAME}:
   
   doce.conc[3] = get-field("mode_livr").
   doce.conc[2] = get-field("refdoc").

   {calcul_document.i}

END.

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE outputHeader w-html 
PROCEDURE outputHeader :
/*------------------------------------------------------------------------
  Purpose:     Output the MIME header, and any "cookie" information needed 
               by this procedure.  
  Parameters:  <none>
  Notes:       In the event that this Web object is state-aware, this is 
               a good place to set the WebState and WebTimeout attributes.
------------------------------------------------------------------------*/

  /* To make this a state-aware Web object, pass in the timeout period
   * (in minutes) before running outputContentType.  If you supply a 
   * timeout period greater than 0, the Web object becomes state-aware 
   * and the following happens:
   *
   *   - 4GL variables webState and webTimeout are set
   *   - a cookie is created for the broker to id the client on the return trip
   *   - a cookie is created to id the correct procedure on the return trip
   *
   * If you supply a timeout period less than 1, the following happens:
   *
   *   - 4GL variables webState and webTimeout are set to an empty string
   *   - a cookie is killed for the broker to id the client on the return trip
   *   - a cookie is killed to id the correct procedure on the return trip
   *
   * For example, set the timeout period to 5 minutes.
   *
   *   setWebState (5.0).
   */
    
  /* Output additional cookie information here before running outputContentType.
   *   For more information about the Netscape Cookie Specification, see
   *   http://home.netscape.com/newsref/std/cookie_spec.html  
   *   
   *   Name         - name of the cookie
   *   Value        - value of the cookie
   *   Expires date - Date to expire (optional). See TODAY function.
   *   Expires time - Time to expire (optional). See TIME function.
   *   Path         - Override default URL path (optional)
   *   Domain       - Override default domain (optional)
   *   Secure       - "secure" or unknown (optional)
   * 
   *   The following example sets custNum=23 and expires tomorrow at (about)
   *   the same time but only for secure (https) connections.
   *      
   *   RUN SetCookie IN web-utilities-hdl 
   *     ("custNum":U, "23":U, TODAY + 1, TIME, ?, ?, "secure":U).
   */ 
  output-content-type ("text/html":U).
  
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE process-web-request w-html 
PROCEDURE process-web-request :
/*------------------------------------------------------------------------
  Purpose:     Process the web request.
  Notes:       
------------------------------------------------------------------------*/
       /* STEP 0 -
   * Output the MIME header and set up the object as state-less or state-aware. 
   * This is required if any HTML is to be returned to the browser. 
   *
   * NOTE: Move 'RUN outputHeader.' to the GET section below if you are going
   * to simulate another Web request by running a Web Object from this
   * procedure.  Running outputHeader precludes setting any additional cookie
   * information.
   */ 
   
  a-lang = INTEGER(get-field("lang")).
  IF a-lang = 0 THEN a-lang = 2.

  IF get-cookie("SessionId") <> "" THEN DO:
     ASSIGN buf-nocli  = INTEGER(ENTRY(1,get-cookie("SessionId")))
            buf-prefix = ENTRY(2,get-cookie("SessionId"))
            buf-nodoc  = INTEGER(ENTRY(3,get-cookie("SessionId"))).
  END.

  RUN outputHeader.
  
  /* Describe whether to receive FORM input for all the fields.  For example,
   * check particular input fields (using GetField in web-utilities-hdl). 
   * Here we look at REQUEST_METHOD. 
   */
  IF REQUEST_METHOD = "POST":U THEN DO:
    /* STEP 1 -
     * Copy HTML input field values to the Progress form buffer. */
    RUN inputFields.

    /* STEP 2 -
     * Open the database or SDO query and and fetch the first record. */
    RUN findRecords.

    DO WITH FRAME {&FRAME-NAME}:

       FIND doce WHERE ROWID(doce) = TO-ROWID(get-field("par-id")) NO-ERROR.


       FIND erreur WHERE erreur.noerr = 101000
                     AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
       lab-bouton[1] = ENTRY(1,erreur.libel).

       FIND erreur WHERE erreur.noerr = 101002
                     AND erreur.lang  = a-lang NO-LOCK NO-ERROR.
       lab-bouton[2] = ENTRY(1,erreur.libel).

       action  = get-field("bouton").
       IF action = "" THEN action = lab-bouton[1].

       IF action = lab-bouton[1] OR
          action = lab-bouton[2] THEN DO:
          RUN modification_document.
       END.

       FIND FIRST docld WHERE docld.nosoc  = doce.nosoc
                          AND docld.typdoc = doce.typdoc
                          AND docld.prefix = doce.prefix
                          AND docld.nodoc  = doce.nodoc
                          AND docld.ref   <> "" NO-LOCK NO-ERROR.
       
       flag-lgdoc = AVAILABLE docld.

    END.

    /* STEP 3 -
     * AssignFields will save the data in the frame.
     * (it automatically upgrades the lock to exclusive while doing the update)
     *
     *  If a new record needs to be created set AddMode to true before
        running assignFields.
     *     setAddMode(TRUE).
     * RUN assignFields. */

    /* STEP 4 -
     * Decide what HTML to return to the user. Choose STEP 4.1 to simulate
     * another Web request -OR- STEP 4.2 to return the original form (the
     * default action).
     *
     * STEP 4.1 -
     * To simulate another Web request, change the REQUEST_METHOD to GET
     * and RUN the Web object here.  For example,
     *
     *  ASSIGN REQUEST_METHOD = "GET":U.
     *  RUN run-web-object IN web-utilities-hdl ("myobject.w":U).
     */

    IF action = lab-bouton[2] THEN DO:

       IF doce.noadrf <> 1000 AND doce.noadrf <> 1001 THEN DO:
          FIND adra WHERE adra.nosoc = doce.nosoc
                      AND adra.noadr = doce.noadrf
                      AND adra.csmt  = doce.csmtf  NO-ERROR.
          IF AVAILABLE adra THEN DO:
             adra.news = get-field("news") = "ON".
             IF get-field("emailx") <> "" THEN adra.mail = get-field("emailx").
          END.
       END.

       ASSIGN REQUEST_METHOD = "GET":U.
       RUN run-web-object IN web-utilities-hdl (get-field("par-retour")).
       RETURN.
    END.

    /* STEP 4.2 -
     * To return the form again, set data values, display them, and output
     * them to the WEB stream.
     *
     * STEP 4.2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.

    /* STEP 4.2b -
     * Enable objects that should be enabled. */
    RUN enableFields.


    alang:SCREEN-VALUE      = STRING(a-lang).
    civilf:SCREEN-VALUE     = get-field("civilf").
    nomfx:SCREEN-VALUE      = get-field("nomfx").
    adr1f:SCREEN-VALUE      = get-field("adr1f").
    adr2f:SCREEN-VALUE      = get-field("adr2f").
    adr3f:SCREEN-VALUE      = get-field("adr3f").
    localf:SCREEN-VALUE     = get-field("localf").
    paysf:SCREEN-VALUE      = get-field("paysf").

    
    civill:SCREEN-VALUE     = get-field("civill").
    nomlx:SCREEN-VALUE      = get-field("nomlx").
    adr1l:SCREEN-VALUE      = get-field("adr1l").
    adr2l:SCREEN-VALUE      = get-field("adr2l").
    adr3l:SCREEN-VALUE      = get-field("adr3l").
    locall:SCREEN-VALUE     = get-field("locall").
    paysl:SCREEN-VALUE      = get-field("paysl").

    emailx:SCREEN-VALUE     = get-field("emailx").
    refcom:SCREEN-VALUE     = get-field("ref").
    MESSAGE2:SCREEN-VALUE   = get-field("message").
    abonews:CHECKED         = get-field("news") = "ON".
    par-retour:SCREEN-VALUE = get-field("par-retour").
    par-id:SCREEN-VALUE     = STRING(ROWID(doce)).
    refs:SCREEN-VALUE       = "".

    /* STEP 4.2c -
     * OUTPUT the Progress form buffer to the WEB stream. */
    RUN outputFields.

  END. /* Form has been submitted. */

  /* REQUEST-METHOD = GET */
  ELSE DO:
    /* This is the first time that the form has been called. Just return the
     * form.  Move 'RUN outputHeader.' here if you are going to simulate
     * another Web request. */

/*     RUN outputHeader.  */

    /* STEP 1 -
     * Open the database or SDO query and and fetch the first record. */
    RUN findRecords.


    /* Return the form again. Set data values, display them, and output them
     * to the WEB stream.
     *
     * STEP 2a -
     * Set any values that need to be set, then display them. */
    RUN displayFields.

    /* STEP 2b -
     * Enable objects that should be enabled. */
    RUN enableFields.

    FIND doce WHERE doce.nosoc  = 1
                AND doce.typdoc = "PA"
                AND doce.prefix = buf-prefix
                AND doce.nodoc  = buf-nodoc NO-ERROR.

    FIND erreur WHERE erreur.noerr = 101033
                  AND erreur.lang  = a-lang NO-LOCK NO-ERROR.

    DO WITH FRAME {&FRAME-NAME}:
       par-id:SCREEN-VALUE = STRING(ROWID(doce)).
       refs:SCREEN-VALUE   = get-field("id").
       par-retour:SCREEN-VALUE = IF get-field("retour") = "" THEN 
                   "commande_valid.w" + "?lang=" + STRING(a-lang)
                                 ELSE get-field("retour") + ".w".
       monnaie:SCREEN-VALUE = doce.codmon.
       alang:SCREEN-VALUE   = STRING(a-lang).

       refcom:SCREEN-VALUE     = get-field("ref").
       MESSAGE2:SCREEN-VALUE   = get-field("message").       

       IF doce.noadrf <> 1000 AND doce.noadrf <> 1001 THEN DO:
          FIND adra WHERE adra.nosoc = doce.nosoc
                      AND adra.noadr = doce.noadrf
                      AND adra.csmt  = doce.csmtf  NO-LOCK NO-ERROR.
          IF AVAILABLE adra THEN DO:

             FIND pays WHERE pays.pays = adra.codpays NO-LOCK NO-ERROR.

             civilf:SCREEN-VALUE = adra.civil.
             nomfx:SCREEN-VALUE  = adra.nom.
             adr1f:SCREEN-VALUE  = adra.adr1.
             adr2f:SCREEN-VALUE  = adra.adr2.
             adr3f:SCREEN-VALUE  = adra.adr3.
             localf:SCREEN-VALUE = adra.local.
             paysf:SCREEN-VALUE  = IF AVAILABLE pays THEN pays.nom ELSE adra.pays.
             emailx:SCREEN-VALUE = adra.mail.
             abonews:CHECKED     = adra.news.
          END.
       END.
       ELSE DO:
          
          civilf:SCREEN-VALUE     = get-field("civilf").
          nomfx:SCREEN-VALUE      = get-field("nomfx").  
          adr1f:SCREEN-VALUE      = get-field("adr1f").
          adr2f:SCREEN-VALUE      = get-field("adr2f").
          adr3f:SCREEN-VALUE      = get-field("adr3f").
          localf:SCREEN-VALUE     = get-field("localf").
          paysf:SCREEN-VALUE      = get-field("paysf").

          civill:SCREEN-VALUE     = get-field("civill").
          nomlx:SCREEN-VALUE      = get-field("nomlx").
          adr1l:SCREEN-VALUE      = get-field("adr1l").
          adr2l:SCREEN-VALUE      = get-field("adr2l").
          adr3l:SCREEN-VALUE      = get-field("adr3l").
          locall:SCREEN-VALUE     = get-field("locall").
          paysl:SCREEN-VALUE      = get-field("paysl").
          abonews:CHECKED         = get-field("news") = "ON".
          emailx:SCREEN-VALUE     = get-field("emailx").
       END.

    END.
    FIND FIRST docld WHERE docld.nosoc  = doce.nosoc
                       AND docld.typdoc = doce.typdoc
                       AND docld.prefix = doce.prefix
                       AND docld.nodoc  = doce.nodoc
                       AND docld.ref   <> "" NO-LOCK NO-ERROR.
    flag-lgdoc = AVAILABLE docld.


    /* STEP 2c -
     * OUTPUT the Progress from buffer to the WEB stream. */
    RUN outputFields.

  END.
  
  /* Show error messages. */
  IF AnyMessage() THEN 
  DO:
     /* ShowDataMessage may return a Progress column name. This means you
      * can use the function as a parameter to HTMLSetFocus instead of 
      * calling it directly.  The first parameter is the form name.   
      *
      * HTMLSetFocus("document.DetailForm",ShowDataMessages()). */
     ShowDataMessages().
  END.
 
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE remplace_tag w-html 
PROCEDURE remplace_tag :
/*------------------------------------------------------------------------------
  Purpose:     
  Parameters:  <none>
  Notes:       
------------------------------------------------------------------------------*/

DEF INPUT        PARAMETER ancre    AS   CHARACTER        NO-UNDO.       
DEF INPUT        PARAMETER nombre   AS   INTEGER          NO-UNDO.       
DEF INPUT        PARAMETER tag      AS   CHARACTER        NO-UNDO.       
DEF INPUT        PARAMETER texte    AS   CHARACTER        NO-UNDO.       
DEF INPUT-OUTPUT PARAMETER ligne    AS   CHARACTER        NO-UNDO.
DEF VAR i          AS   INTEGER                    NO-UNDO.
DO i = 1 TO nombre:
   IF INDEX(tag,ancre + STRING(i,"99")) <> 0 THEN ligne = REPLACE(ligne,tag,ENTRY(i,texte,"#")).
END.
END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

